var 箱子名 = "神秘之影";
status = -1;
var itemList = [1213018, 1292018, 1592020, 1272017, 1282017, 1212120, 1222113, 1232113, 1242121, 1242122, 1252098, 1262039, 1302343, 1312203, 1322255, 1332279, 1342104, 1362140, 1372228, 1382265, 1402259, 1412181, 1422189, 1432218, 1442274, 1452257, 1462243, 1472265, 1482221, 1492235, 1522143, 1532150, 1542117, 1552119, 1582023];
function start() {
    action(1, 0, 0)
}
function action(e, d, c) {
    if (status == 0 && e == 0) {
        cm.dispose();
        return
    }
    if (e == 1) {
        status++
    } else {
        status--
    }
    if (!cm.getzhizunvip() == 2) {
        cm.dispose();
        cm.playerMessage(1, "该功能是至尊版专享。");
        return
    }
    if (status == 0) {
        if (cm.getSpace(1) < 2 || cm.getSpace(2) < 2 || cm.getSpace(3) < 2 || cm.getSpace(4) < 2 || cm.getSpace(5) < 2) {
            cm.sendOk("你的背包满了，每一栏都要留2个位置。");
            cm.dispose();
            return
        }
        text = "#b请选择你要获得的#r" + 箱子名 + "#b装备：\r\n#fn方正粗黑宋简体#";
        for (var a = 0; a < itemList.length; a++) {
            text += "#L" + a + "##i" + itemList[a] + "# #b#z" + itemList[a] + "##l\r\n"
        }
        cm.askMenu(text)
    } else {
        if (status == 1) {
            cm.sendOk("获得 #b#e#v" + itemList[c] + "##z" + itemList[c] + "# #n#k确定了吗？");
            selects = c
        } else {
            if (status == 2) {
                var b = cm.getItemInfo();
                cm.gainGachaponItem(itemList[selects], 1, "" + 箱子名 + "装备箱", 3);
                cm.gainItem(2430029, 0);
                cm.dispose()
            }
        }
    }
};
